// UsesVarTable.h : stores the statement and procedures which use each variable.
// Author: Achyut P Balaji
//

#ifndef USES_VAR_TABLE_H
#define USES_VAR_TABLE_H
#include"SPA_Data_Types.h"

using namespace std;


class UsesVarTable {
private:
	vector<STMT_LIST> stmtUsedIn;
	vector<PROC_LIST> procUsedIn;
	static UsesVarTable *obj;
	UsesVarTable();
public:
	static UsesVarTable* getInstance();
	BOOLEAN addStmt(VAR_INDEX v, STATEMENT_INDEX n);
	BOOLEAN addProc(VAR_INDEX v, PROC_INDEX p);
	BOOLEAN isUsed(INDEX n, VAR_INDEX ind, VECTORLIST_TYPE type);
	STMT_LIST getStmtUsedIn(VAR_INDEX v);
	PROC_LIST getProcUsedIn(VAR_INDEX v);
	void initialise(int size);
};
#endif